<?php

/**
 * ContactStudent filter form base class.
 *
 * @package    ecollegeplus
 * @subpackage filter
 * @author     Batanayi Matuku
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedInheritanceTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseContactStudentFormFilter extends ContactFormFilter
{
  protected function setupInheritance()
  {
    parent::setupInheritance();

    $this->widgetSchema   ['student_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Student'), 'add_empty' => true));
    $this->validatorSchema['student_id'] = new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Student'), 'column' => 'id'));

    $this->widgetSchema   ['postal_address_line_1'] = new sfWidgetFormFilterInput(array('with_empty' => false));
    $this->validatorSchema['postal_address_line_1'] = new sfValidatorPass(array('required' => false));

    $this->widgetSchema   ['postal_address_line_2'] = new sfWidgetFormFilterInput();
    $this->validatorSchema['postal_address_line_2'] = new sfValidatorPass(array('required' => false));

    $this->widgetSchema   ['postal_postcode'] = new sfWidgetFormFilterInput();
    $this->validatorSchema['postal_postcode'] = new sfValidatorPass(array('required' => false));

    $this->widgetSchema   ['postal_city'] = new sfWidgetFormFilterInput();
    $this->validatorSchema['postal_city'] = new sfValidatorPass(array('required' => false));

    $this->widgetSchema   ['postal_country_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('PostalCountry'), 'add_empty' => true));
    $this->validatorSchema['postal_country_id'] = new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('PostalCountry'), 'column' => 'id'));

    $this->widgetSchema   ['postal_state_province_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('PostalStateProvince'), 'add_empty' => true));
    $this->validatorSchema['postal_state_province_id'] = new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('PostalStateProvince'), 'column' => 'id'));

    $this->widgetSchema   ['guardian_first_name'] = new sfWidgetFormFilterInput();
    $this->validatorSchema['guardian_first_name'] = new sfValidatorPass(array('required' => false));

    $this->widgetSchema   ['guardian_last_name'] = new sfWidgetFormFilterInput();
    $this->validatorSchema['guardian_last_name'] = new sfValidatorPass(array('required' => false));

    $this->widgetSchema   ['guardian_email_address'] = new sfWidgetFormFilterInput();
    $this->validatorSchema['guardian_email_address'] = new sfValidatorPass(array('required' => false));

    $this->widgetSchema   ['guardian_phone_work'] = new sfWidgetFormFilterInput();
    $this->validatorSchema['guardian_phone_work'] = new sfValidatorPass(array('required' => false));

    $this->widgetSchema   ['guardian_phone_home'] = new sfWidgetFormFilterInput();
    $this->validatorSchema['guardian_phone_home'] = new sfValidatorPass(array('required' => false));

    $this->widgetSchema   ['guardian_phone_mobile'] = new sfWidgetFormFilterInput();
    $this->validatorSchema['guardian_phone_mobile'] = new sfValidatorPass(array('required' => false));

    $this->widgetSchema   ['guardian_address_line_1'] = new sfWidgetFormFilterInput();
    $this->validatorSchema['guardian_address_line_1'] = new sfValidatorPass(array('required' => false));

    $this->widgetSchema   ['guardian_address_line_2'] = new sfWidgetFormFilterInput();
    $this->validatorSchema['guardian_address_line_2'] = new sfValidatorPass(array('required' => false));

    $this->widgetSchema   ['guardian_postcode'] = new sfWidgetFormFilterInput();
    $this->validatorSchema['guardian_postcode'] = new sfValidatorPass(array('required' => false));

    $this->widgetSchema   ['guardian_city'] = new sfWidgetFormFilterInput();
    $this->validatorSchema['guardian_city'] = new sfValidatorPass(array('required' => false));

    $this->widgetSchema   ['guardian_country_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GuardianCountry'), 'add_empty' => true));
    $this->validatorSchema['guardian_country_id'] = new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('GuardianCountry'), 'column' => 'id'));

    $this->widgetSchema   ['guardian_state_province_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GuardianStateProvince'), 'add_empty' => true));
    $this->validatorSchema['guardian_state_province_id'] = new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('GuardianStateProvince'), 'column' => 'id'));

    $this->widgetSchema->setNameFormat('contact_student_filters[%s]');
  }

  public function getModelName()
  {
    return 'ContactStudent';
  }

  public function getFields()
  {
    return array_merge(parent::getFields(), array(
      'student_id' => 'ForeignKey',
      'postal_address_line_1' => 'Text',
      'postal_address_line_2' => 'Text',
      'postal_postcode' => 'Text',
      'postal_city' => 'Text',
      'postal_country_id' => 'ForeignKey',
      'postal_state_province_id' => 'ForeignKey',
      'guardian_first_name' => 'Text',
      'guardian_last_name' => 'Text',
      'guardian_email_address' => 'Text',
      'guardian_phone_work' => 'Text',
      'guardian_phone_home' => 'Text',
      'guardian_phone_mobile' => 'Text',
      'guardian_address_line_1' => 'Text',
      'guardian_address_line_2' => 'Text',
      'guardian_postcode' => 'Text',
      'guardian_city' => 'Text',
      'guardian_country_id' => 'ForeignKey',
      'guardian_state_province_id' => 'ForeignKey',
    ));
  }
}
